package com.meisupic.copyright.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.meisupic.copyright.common.AuthorizeRuleEnum;
import com.meisupic.copyright.util.CategoryUtil;
import com.meisupic.copyright.util.DictionaryUtil;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import lombok.Data;

/**
 * creation wuxun
 *
 * @version V1.0
 * @Description: 登记作品修改时返回给前端的对象
 * @date 2018/1/21 10:17
 */
@Data
public class CopyRightWorksResponseVo implements Serializable {

  private static final long serialVersionUID = 3672215050907817092L;

  private String worksFullName;

  private String worksType;

  private String worksTypeName;

  private String author;

  private String creationCountry;

  private String creationProvince;

  private String creationCity;

  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  private Date creationDate;

  private Integer publishStatus;

  private String publishStatusName;

  private String firstPublishCountry;

  private String firstPublishProvince;

  private String firstPublishCity;

  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  private Date firstPublishDate;

  private String mainFeatures;

  private Integer categoryId;

  private String categoryName;

  private String keywords;

  private AuthorizeRuleEnum authorizeRule;

  private String authorizeRuleDesc;

  private BigDecimal splitPercentage;

  private Integer price;

  private List<WorksImageVo> imagesName;

  private String creativeStatement;

  private String originalStatement;

  private String cooperationStatement;

  private Integer creativeNature;

  private String  creativeNatureName;

  private String rCode;

  private String certificateUrl;

  private String subWorksType;

  public String getWorksTypeName() {

    return DictionaryUtil.getDicNameByValue(this.getWorksType(), "worktype");
  }

  public String getPublishStatusName() {
    return DictionaryUtil.getDicNameByValue(this.getPublishStatus().toString(), "publishstatus");
  }

  public String getCategoryName() {
    return CategoryUtil.getCategoryName(this.getCategoryId());
  }

  public String getCreativeNatureName() {
    return DictionaryUtil.getDicNameByValue(this.getCreativeNature().toString(),"creativeNature");
  }

  public String getAuthorizeRuleDesc() {
    return this.getAuthorizeRule().getDesc();
  }
}
